﻿@model IEnumerable<PaymentMethodModel>

@{    
	ViewBag.Title = T("Admin.Configuration.Payment.Methods").Text;
}

<div class="section-header">
    <div class="title">
        <i class="far fa-credit-card"></i>
        @T("Admin.Configuration.Payment.Methods")
    </div>
	<div class="options">
		@{ Html.RenderWidget("admin_button_toolbar_before"); }

		@{ Html.RenderWidget("admin_button_toolbar_after"); }
	</div>
</div>

<table class="adminContent">
	<tr>
		<td>
			@Html.ProviderList(Model,
			@<div>
				<table class="payment-method-features">
					<tr><td>@T("Admin.Configuration.Payment.Methods.Fields.RecurringPaymentType"):</td><td>@item.RecurringPaymentType</td></tr>
					<tr><td>@Html.DisplayNameFor(model => model.SupportCapture):</td><td>@YesNoLabel(item.SupportCapture)</td></tr>
					<tr><td>@Html.DisplayNameFor(model => model.SupportRefund):</td><td>@YesNoLabel(item.SupportRefund)</td></tr>
					<tr><td>@Html.DisplayNameFor(model => model.SupportPartiallyRefund):</td><td>@YesNoLabel(item.SupportPartiallyRefund)</td></tr>
					<tr><td>@Html.DisplayNameFor(model => model.SupportVoid):</td><td>@YesNoLabel(item.SupportVoid)</td></tr>
				</table>
			</div>,
			@<div>
				<a style="min-width: 150px" class='btn@(item.IsActive ? " btn-secondary btn-to-danger" : " btn-success")' href='@Url.Action("ActivateProvider", new { systemName = item.SystemName, activate = !item.IsActive })'>
					<span>@T("Admin.Common.{0}".FormatInvariant(item.IsActive ? "Deactivate" : "Activate"))</span>
				</a>
			</div>)
		</td>
	</tr>
</table>

@helper YesNoLabel(bool value)
{ 
	if (value)
	{
		<span class="badge badge-success">@T("Common.Yes")</span>
	}
	else
	{
		<span class="badge badge-dark">@T("Common.No")</span>
	}
}

